package com.caojing.syby.ui.brandsale.brandchilddetails;

import com.caojing.syby.bean.brand.BrandBean;
import com.caojing.syby.bean.home.HomeGvBean;
import com.caojing.syby.httputils.HttpUtils;
import com.caojing.syby.ui.brandsale.brandchildfragment.BrandChildContract;

import java.util.HashMap;

/**
 * Created by My on 2016/10/8.
 */
public class BrandChildDetailsPersenter implements BrandChildDetailsContract.Presenter {

    private BrandChildDetailsContract.View view;
    private BrandChildDetailsContract.Model model;

    public BrandChildDetailsPersenter(BrandChildDetailsContract.View view){
        this.view=view;
        this.model=new BrandChildDetailsModel();
    }

    @Override
    public void initBrandDetailsData(HashMap<String, String> params) {
        model.getBrandDetailsSuccess(params, new HttpUtils.HttpCallBack<HomeGvBean>() {
            @Override
            public void onSucess(HomeGvBean homeGvBean) {
                view.onBrandDetailsSuccess(homeGvBean);
            }
            @Override
            public void onFail() {
                view.onBrandDetailsDataFail("请检查你的网络");
            }
        });
    }
}
